package main

import (
	"fmt"
	"go_utils_demo/go_utils"
)

func main() {
	// TODO: Implement me
	objectOne := go_utils.NewSingleton()
	objectOne.Data["name"] = "aclie"
	objectTwo := go_utils.NewSingleton()
	objectTwo.Data["name"] = "bruce"
	objectTwo.Data["age"] = 20

	fmt.Println(objectOne == objectTwo)
	println(objectOne.Data["name"])
	println(objectOne.Data["name"].(string))
	println(objectTwo.Data["name"].(string))
	println(objectTwo.Data)
	println(len(objectTwo.Data))
	println("-------------------------")
	println(go_utils.Iif_string(true, "真", "假"))
	println("-------------------------")
	// Ex:  data: []string{"A", "B", "C"}; Join(data) ==> "A,B,C" ; Join(data, "|") ==> "A|B|C"
	name := go_utils.Join([]string{"A", "B", "C"}, "|")
	println(name)
	data := []string{"A", "B", "C"}
	println(go_utils.Join(data))
	println(go_utils.Join(data, "|"))
	println("-------------------------")
	println(go_utils.FileExists("run.bat"))
	println("-------------------------")
	println(go_utils.StringSliceContains("A", []string{"A", "B", "C"}))
	println("-------------------------")
	for i, a := range []string{"A", "B", "C"} {
		println(i, "_", a)
	}
	println("-------------------------")
	for idx := 0; idx < 5; idx++ {
		println(idx)
	}
	println("-------------------------")
	println(go_utils.ToInt64("21"))

}
